package com.myappengine.dao;

import java.util.List;

import javax.jdo.PersistenceManager;
import javax.jdo.Query;

import com.myappengine.model.Instructor;

public class InstructorDAO {
	
	@SuppressWarnings("unchecked")
	public List<Instructor> getAllInstructors() {
		PersistenceManager pm = PMF.getPersistenceManager().getPersistenceManager();
		try {
			Query query = pm.newQuery(Instructor.class);
			return (List<Instructor>) query.execute();
		} finally {
			pm.close();
		}
	}
}
